package com.reader.api.service.usercenter;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.reader.api.entity.usercenter.APPToken;
import com.reader.api.entity.usercenter.DeviceInfo;
import com.reader.api.entity.usercenter.User;
import java.util.Map;

/**
 * <p>
 *  APP用户 service
 * </p>
 *
 * @author jiahaikun
 * @date 2018-11-1
 */
public interface IUserService extends IService<User> {

    /**
     *
     * @param mobile
     * @param deviceInfo
     * @return
     */
    public APPToken login(String mobile, DeviceInfo deviceInfo );

    Page<Map<String,Object>> selectListPage(int currentPage, int size, String loginId, String name, String code);

    /**
     * 通过token 获取用户ID.业务中需要得到userid
     *
     * @param token
     * @return
     */
    public Integer getUserIdByToken(String token);

    /**
     * 通过电话获取用户
     * @return
     */
    public User getUserByMobile(String mobile);

    /**
     * 获取用户信息.
     * @param user
     * @return
     */
    User getUserInfo(User user);

    User getUserInfo(String mobile);
}
